package umg.gui;

import java.awt.Component;

import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.table.TableCellRenderer;

public class JLabelTableCellRenderer extends JLabel implements TableCellRenderer
{

	private static final long serialVersionUID = -7518079417093740092L;

	// This method is called each time a cell in a column
	// using this renderer needs to be rendered.
	public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int rowIndex, int vColIndex)
	{
		// 'value' is value contained in the cell located at
		// (rowIndex, vColIndex)

		if (isSelected)
		{
			// cell (and perhaps other cells) are selected
		}

		if (hasFocus)
		{
			// this cell is the anchor and the table has the focus
		}

		// Configure the component with the specified value
		//setText(value.toString());

		// Set tool tip if desired
		//setToolTipText((String)value);

		// Since the renderer is a component, return itself
		return this;
	}

	// The following methods override the defaults for performance reasons
	public void validate()
	{
	}

	public void revalidate()
	{
	}

	protected void firePropertyChange(String propertyName, Object oldValue, Object newValue)
	{
	}

	public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue)
	{
	}
}
